﻿' Compiler Options:
Option Explicit On
Option Strict On
Option Infer Off

Public Class zTextCodeMW


    '' TODOMW: Old code delete later.
    ''//*Private Property m_WordToSpell As String = "Happy"
    ''Private Property m_WordToSpellContext As String = "I am happy to see you."
    ''Private Property m_WordToSpellDefinition As String = "Feeling or showing pleasure or contentment."
    ''Private Property m_WordToSpellCurrentCorrect As String
    ''Private Property m_WordToSpellCurrentCharacter As Char = CChar("H")
    ''Private Property m_WordToSpellCompleted As Boolean
    ''*//Private Property m_WordToSpellCurrentCharacterIndex As Integer

    '' NOTE: 
    ''       Historically, arrays are the primary structures for storing sets of data, and for years they were
    ''       the primary storage mechanism for in-memory data manipulation. In this field, however,
    ''       where technologies grow in and out of style overnight, arrays are being replaced by other,
    ''       more flexible and more powerful structures, the collections.
    ''                                                                   Excerpt from Mastering Microsoft® Visual Basic® 2010 Evangelos Petroutsos




    ''//Dim m_WordListIndex As Integer

    ''//Dim m_WordToSpell(15) As WordToSpellRecord


    ' '' TODOMW: Build these variables using a Structure then compare building as a class to access variables.
    ''//*Structure WordToSpellRecord
    ''    Dim Word As String
    ''    Dim Context As String
    ''    Dim Definition As String
    ''    Dim CurrentCorrect As String
    ''    Dim CurrentCharacter As String
    ''    Dim Completed As Boolean
    ''    Dim CurrentCharacterIndex As Integer
    ''*//End Structure



    ''//Dim WordsToSpell As New List(Of WordToSpellRecord)

    'Public Sub New()
    '    ' NOTE: The reason you must call the New method of the base class is that the base class
    '    '       might have its own constructor, which can't be called directly.
    '    MyBase.New()

    '    ' TODOMW: Fix code. Work out logic of events in SpeechMW Class
    '    ' Register for events.
    '    '//AddHandler oSpeechMW.SpeakCompleted, AddressOf SpeachComplete

    'End Sub

    'Private Function GetNextWordToSpellCharacterIndex() As Integer
    '    Dim result As Integer

    '    If m_WordToSpellCurrentCharacterIndex < m_WordToSpell.Length Then
    '        m_WordToSpellCurrentCharacterIndex = m_WordToSpellCurrentCharacterIndex + 1
    '        result = m_WordToSpellCurrentCharacterIndex
    '    ElseIf m_WordToSpellCurrentCharacterIndex = m_WordToSpell.Length Then
    '        m_WordToSpellCompleted = True
    '        result = m_WordToSpell.Length
    '        m_oSoundsMW.PlaySoundWordCorrect()
    '    End If

    '    Return result
    'End Function

    'Public Function GetWordToSpell() As String
    '    Return m_WordToSpell
    'End Function

    'Public Function GetWordToSpellCurrentCorrect() As String
    '    Return m_WordToSpellCurrentCorrect
    'End Function

    'Public Function GetWordInContext() As String
    '    Return m_WordToSpellContext
    'End Function

    'Public Function GetWordDefinition() As String
    '    Return m_WordToSpellDefinition
    'End Function

    'Public Function SayString(ByVal textToSpeak As String) As Boolean
    '    ' TODOMW:   Rather than boolean to pass back to the calling function pass back a Prompt object.
    '    '           This can then be used to stop speech by using the returned object.
    '    m_oSpeechMW.SayString(textToSpeak)
    'End Function

    'Public Function SayStop() As Boolean
    '    m_oSpeechMW.SayStop()
    'End Function

    'Public Function GetWordToSpellCurrentCharacterIndex() As Integer
    '    Return m_WordToSpellCurrentCharacterIndex
    'End Function

    'Protected Overrides Sub Finalize()
    '    ' TODOMW:   This function can be deleted if it does not contain any relevant code.
    '    '           Put the NOTE below into the header of this class if you like.


    '    ' NOTE:  The only time you should set a variable to Nothing is when its lifetime is long 
    '    '       relative to the time the garbage collector takes to detect orphaned objects.
    '    '
    '    '       Reference from: MSDN - Object Lifetime: How Objects Are Created and Destroyed (Visual Basic)
    '    '                       Garbage Collection and the Finalize Destructor
    '    '       http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k%28VB.CONSTRUCTOR%29;k%28TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV4.0%22%29;k%28DevLang-VB%29&rd=true           

    '    ' NOTE: Setting object is not required any more see above reference from MSDN.
    '    '//*m_oSpeechMW = Nothing
    '    'm_oSoundsMW = Nothing
    '    '*//m_oWordsToSpellMW = Nothing

    '    ' Call destructor for base class last.
    '    MyBase.Finalize()
    'End Sub


    '//If Char.IsLetterOrDigit(e.KeyChar) Then
    '//if Char.IsLetter then

    ' EXAMPLE CODE: If Me.ActiveControl.GetType Is GetType(TextBox) Then

    '====================================================
    ' Array test code function only.
    '====================================================
    'Public Function ShowLessonWordList() As Boolean
    '    Dim result As Boolean

    '    Dim iWord As Integer
    '    Dim iConDef As Integer
    '    Dim s As String

    '    '    Dim WordsArray(4, 2) As String
    '    s = ""

    '    For iConDef = 0 To WordsArray.GetUpperBound(1)
    '        s += vbCrLf
    '        For iWord = 0 To WordsArray.GetUpperBound(0)
    '            s += vbCrLf & WordsArray(iWord, iConDef)
    '        Next iWord
    '    Next iConDef



    '    If Not IsNothing(s) Then
    '        result = True
    '        MsgBox(s)
    '    End If

    '    Return result
    'End Function


End Class
